#列表去重

#使用set()函数
numbers = [1,2,2,3,4,4,5]
unique_numbers = list(set(numbers))
print(unique_numbers)

'''#使用字典去重并保持顺序
numbers = [1,2,2,3,4,4,5]
unique_numbers = list(dict.fromkeys(numbers))
print(unique_numbers)

#使用itertools模块
from itertools import filterfalse
numbers = [1,2,2,3,4,4,5]
def unique_everseen(iterable):
    seen = set()
    seen_add = seen.add
    for element in filterfalse(seen.__contains__, iterable):
        seen_add(element)
        yield element
unique_numbers = list(unique_everseen(numbers))
print(unique_numbers)
'''